<?php
try{
    if(isset($this->categories) && count($this->categories) > 0 ){
        foreach($this->categories as $category){
            if(isset ($category->cars) && count($category->cars)> 0){
?>
<div  class="box">
      <div class="b-title">
            <div class="bt-wrapper"><?php echo $category->name;?></div>
      </div>
      <div class="b-container">
      <?php
                foreach($category->cars as $car){
                    $arrImages = explode('@', $car->feature_image);

            ?>
        <div class="product">
            <a href="<?php echo $this->url(array("slug" => $car->slug), "post_view");?>" title="">
            <?php
            if(extension_loaded("gd") && function_exists("exec") ){
            ?>
                <img src="<?php echo PUBLIC_URL.'/plugins/phpThumb/phpThumb.php?src='.$arrImages[0].'&amp;w=145&amp;h=95'?>" alt="<?php echo $car->title?>"/>
            <?php }else{?>
                <img src="<?php echo $arrImages[0];?>" alt="<?php echo $car->title?>" width="145px" height="95px"/>
            <?php }?>

            </a>
            <div>
              <h4><a href="<?php echo $this->url(array("slug" => $car->slug), "post_view");?>"><?php echo $car->title;?></a></h4>
                                <span class="price">Giá: <?php echo number_format($car->price);?></span>
              <span class="hot"></span>
            </div>
        </div>
      <?php
       }
      ?>
            <div class="readmore clearfix">
                <a href="<?php echo $this->url(array("slug" => $category->slug), "category_view");?>">&raquo; Xem tất cả</a>
            </div>
      </div>
</div>
<?php
               
            }
    }
}
}  catch (Exception $ex){
    echo $ex->getMessage();
}

?>